package com.ourteam.product.ui.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-14 15:16:01 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductUITableColumnIconBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.ui.dao.ProductUITableColumnIcon productUITableColumnIcon;

  protected BeanMap getBeanMap() {

    return new BeanMap(productUITableColumnIcon);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.ui.dao.IProductUITableColumnIconDAO.Id);

    mappedDaoFields.put(
        "columnId", com.ourteam.product.ui.dao.IProductUITableColumnIconDAO.ColumnId);

    mappedDaoFields.put(
        "dataValue", com.ourteam.product.ui.dao.IProductUITableColumnIconDAO.DataValue);

    mappedDaoFields.put(
        "dataIcon", com.ourteam.product.ui.dao.IProductUITableColumnIconDAO.DataIcon);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductUITableColumnIconBean() {
    super();

    this.productUITableColumnIcon = new com.ourteam.product.ui.dao.ProductUITableColumnIcon();
  }

  public ProductUITableColumnIconBean(
      com.ourteam.product.ui.dao.ProductUITableColumnIcon productUITableColumnIcon) {
    super();

    this.productUITableColumnIcon = productUITableColumnIcon;
  }

  public com.ourteam.product.ui.dao.ProductUITableColumnIcon convertToProductUITableColumnIcon() {
    return this.productUITableColumnIcon;
  }

  public com.ourteam.product.ui.dao.ProductUITableColumnIcon convertTo() {
    return this.productUITableColumnIcon;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productUITableColumnIcon.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productUITableColumnIcon.setId(id);
  }

  /**
   * Get columnId
   *
   * @return long
   */
  public long getColumnId() {
    return (long) this.productUITableColumnIcon.getColumnId();
  }

  /**
   * Set columnId
   *
   * @parameter long
   */
  public void setColumnId(long columnId) {

    this.productUITableColumnIcon.setColumnId(columnId);
  }

  /**
   * Get dataValue
   *
   * @return String
   */
  public String getDataValue() {
    return (String) this.productUITableColumnIcon.getDataValue();
  }

  /**
   * Set dataValue
   *
   * @parameter String
   */
  public void setDataValue(String dataValue) {

    this.productUITableColumnIcon.setDataValue(dataValue);
  }

  /**
   * Get dataIcon
   *
   * @return String
   */
  public String getDataIcon() {
    return (String) this.productUITableColumnIcon.getDataIcon();
  }

  /**
   * Set dataIcon
   *
   * @parameter String
   */
  public void setDataIcon(String dataIcon) {

    this.productUITableColumnIcon.setDataIcon(dataIcon);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductUITableColumnIconBean) == false) {
      return false;
    } // end if

    ProductUITableColumnIconBean other = (ProductUITableColumnIconBean) obj;

    boolean isEqual = false;

    com.ourteam.product.ui.dao.ProductUITableColumnIcon tempProductUITableColumnIcon =
        other.convertToProductUITableColumnIcon();

    if (tempProductUITableColumnIcon == null || this.productUITableColumnIcon == null) {
      isEqual = false;
    } else if (tempProductUITableColumnIcon == this.productUITableColumnIcon
        || tempProductUITableColumnIcon.equals(this.productUITableColumnIcon)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductUITableColumnIconBean[] toArray(
      com.ourteam.product.ui.dao.ProductUITableColumnIcon[] aProductUITableColumnIcons) {

    return toArray(aProductUITableColumnIcons, null);
  }

  public static ProductUITableColumnIconBean[] toArray(
      com.ourteam.product.ui.dao.ProductUITableColumnIcon[] aProductUITableColumnIcons,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductUITableColumnIcons)) {
      return new ProductUITableColumnIconBean[0];
    }

    int length = aProductUITableColumnIcons.length;

    ProductUITableColumnIconBean[] beans = new ProductUITableColumnIconBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductUITableColumnIconBean(aProductUITableColumnIcons[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductUITableColumnIcons[i]});
      }
    }

    return beans;
  }
}
